package team.hyznrj.studentsys.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import team.hyznrj.studentsys.dao.repository.AcademicYearsRepository;
import team.hyznrj.studentsys.entity.AcademicYears;
import team.hyznrj.studentsys.service.AcademicYearsService;

import java.util.List;

/**
 * @author ReMidDream
 * @date 2018-04-23 15:37
 **/
@Service
public class AcademicYearsServiceImpl implements AcademicYearsService {

    @Autowired
    private AcademicYearsRepository academicYearsRepository;

    @Override
    public List<AcademicYears> findAll() {
        return academicYearsRepository.findAll();
    }

    @Override
    public AcademicYears insertOrUpdateAcademicYears(AcademicYears academicYears) {
        return academicYearsRepository.save(academicYears);
    }

    @Override
    public void deleteAcademicYears(Integer academicYearId) {
        academicYearsRepository.delete(academicYearId);
    }
}
